.github: run Sonar Check only on PRs from apache/cloudstack branches#8058
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.18 #8058 +/- ##
============================================
+ Coverage 13.02% 13.06% +0.04%
- Complexity 9032 9108 +76
============================================
Files 2720 2720
Lines 257080 257537 +457
Branches 40088 40156 +68
============================================
+ Hits 33476 33658 +182
- Misses 219400 219649 +249
- Partials 4204 4230 +26
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| jobs: | ||
| build: | ||
| if: github.repository == 'apache/cloudstack' | ||
| if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository |
There was a problem hiding this comment.
| if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository | |
| if: github.event.pull_request.head.repo.full_name == github.repository |
i.e. people may run sonar on their own forks?
There was a problem hiding this comment.
if so, users need to configure sonar token in github project.
For example, if someone creates a PR in shapeblue (forked) repositories, currently the sonar check is skipped.
But with this change, sonar check will not be skipped, but fail (as sonar token does not exist in project settings).
There was a problem hiding this comment.
but only if they create a PR from their own repo to their own repo, so they have control on whether they create the token or not.
There was a problem hiding this comment.
yes. so between these 2 options with forks
- enable PR sonar check by default. users need to disable it by code changes if they do not have sonar token.
- disable PR sonar check by default. users need to enable it by code changes if they have sonar token.
the PR sonar check was disabled on forks by #7199
we can change the behaviour if needed
There was a problem hiding this comment.
ps: the PR codecov check was disabled on forks by #7177
There was a problem hiding this comment.
but in both cases the code may not be merged, inconvenient :(
There was a problem hiding this comment.
Right...we have to choose one of the two options.
Let's assume that most users do not have sonar token, so we run sonar check only on apache/cloudstack repository. Make sense ?
…pache#8058) This PR fixes apache#8050 (cherry picked from commit 864a195) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Description
This PR fixes #8050
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?